/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.com.smart.hawk.utilities;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Andres Felipe Escobar Lopez
 */
public  class HawkSessionMgr {

    private static HawkSessionMgr instance = null;
    private static Map<String, Object> mapaSession = new HashMap<>();

    public static synchronized HawkSessionMgr getInstance() {

        if (instance == null) {
            instance = new HawkSessionMgr();
        }

        return instance;
    }

    public void setSession(String key, Object object) {
        if (mapaSession != null) {
            mapaSession.put(key, object);
        }
    }
    
    public Object getSession(String key){
        return mapaSession.get(key);
    }
    
    public void removeSession(String key){
        mapaSession.remove(key);
    }
    
    public void removeSession(){
        mapaSession.clear();
        mapaSession = new HashMap<>();
    }
    
}
